package com.ashye.jsstartapp;

import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import java.net.URI;

public class MainActivity extends AppCompatActivity {

    private Button btn;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        btn = (Button) findViewById(R.id.btn_start_app);

        getParameter();
    }


    private void getParameter() {
        if (Intent.ACTION_VIEW.equals(getIntent().getAction())) {
            Intent intent = getIntent();
            Uri uri = intent.getData();
            btn.setText(uri.toString());
        }
    }
}
